The Global Economy contracted sharply with the COVID-19 pandemic, leading heavily to a recession in most countries. Governments across the world were facing a health, social and economic crisis. Markets were hitting new lows; trades were on a halt and the population was in a panic while hospitals were overwhelmed. It was up to the government and financial institutions to roll out fiscal measures to combat the pandemic and protect the people.
Elliott Harris, the UN Chief Economist, and the Assistant Secretary-General for Economic Development stated that "The pace and strength of the recovery of the crisis not only hinges on the efficacy of public health measures in slowing the spread of the virus but also on the ability of countries to protect jobs and incomes, particularly of the most vulnerable members of our societies.”
Different types of fiscal policy measures taken across countries to tackle the pandemic is analysed in this notebook. Based on the types of policies taken by the best-performing countries^, policy measures will be recommended to the worst-performing countries^^.
To achieve this, data will be analysed to find the best and the worst-performing countries. This will narrow the search down to the top 10 and bottom 10 countries in terms of GDP percentage change. Analyses will majorly focus on each country's income level, policy implementation authority, and types of policy measures. This data would help recommend the type of policy measures the worst-performing countries should have taken to tackle the Great Lockdown better.
^Countries with the highest percentage change in 2020-2021 GDP as best-performing countries. ^^Countries with the worst percentage change in 2020-2021 GDP as worst-performing countries.
The analysis was done by merging two datasets:
"COVID-19 Finance Starter EDA" hosted by Bojan Tunguz in CSV format. The dataset consists of nearly 4000 rows with data on different policy measures taken by 157 countries.
Annual GDP for every country in the world by the World Bank in CSV format.
The datasets contain the following attributes:
How did the GDP change in countries around the world before and during the pandemic?
All countries went into losses but who was hit the worst?
What steps were taken by the best performing countries to improve this economic situation?
What policy measures taken by the better-performing countries can be suggested to the worst-performing countries?
Are there low-income countries that performed relatively well in terms of increase in GDP?
#Importing required libraries for data analysis and visualization
import pandas as pd
import datetime as dt
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
import plotly.express as px
import plotly.graph_objects as go
covid_db = pd.read_csv('covid-fci-data.csv' , index_col='Country Name', encoding = "ISO-8859-1", skipinitialspace = True)
worldbank_db = pd.read_csv('worldbank_db.csv', index_col='Country Name', skiprows = 4, skipinitialspace = True)
#Renaming White Space from Country ISO3 code
covid_db['Country ISO3']=covid_db['Country ISO3'].str.strip()
#Filtering the data as data related to pre, during and post covid years is required for analysis
gdp_db=worldbank_db[['Country Code','Indicator Name','Indicator Code','2018','2019','2020','2021']]
#Exception handling for chained assignment warning
pd.set_option("mode.chained_assignment",None)
#Getting observations with NaN values in gdp data
na_observations=gdp_db[gdp_db.isna().any(axis=1)]
#Dropping the observations with NaN values
gdp_db.dropna(inplace=True)
#Renaming the Country Code Column for further merging
gdp_db=gdp_db.rename(columns={'Country Code':'Country ISO3'})
#Resetting the index of Covid Database so that the Country Name is a column for cleaning
covid_db.reset_index(inplace=True)
#Filtering the covid database by removing the countries which have corresponding NaN values in GDP data
covid_db=covid_db[~covid_db['Country ISO3'].isin(na_observations.index)]
The two databases are combined on the common Country ISO3 Code columns.
#Merging Covid Database and GDP database by inner joining on Country Name
merged_data=pd.merge(covid_db,gdp_db,how='inner',on='Country ISO3')
merged_data
| Country Name | ID | Country ISO3 | Income Level | Authority | Date | Level 1 policy measures | Level 2 policy measures | Level 3 policy measures | Details of the measure | Reference | Termination Date | Modification of Parent Measure | Parent Measure | Indicator Name | Indicator Code | 2018 | 2019 | 2020 | 2021 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | China | 1 | CHN | Upper middle income | SUP | 2/1/20 | Banking sector | Operational continuity ... | Blank ... | Require banks and insurance companies to ensur... | http://www.gov.cn/zhengce/zhengceku/2020-02/03... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 1 | China | 3 | CHN | Upper middle income | CB | 2/5/20 | Banking sector | Integrity ... | Other integrity ... | The PBC has issued Notices on AML/CFT requirem... | NaN | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 2 | China | 9 | CHN | Upper middle income | CB | 2/17/20 | Liquidity/funding | Policy rate ... | Blank ... | Medium-term lending facility (MLF) rate cut by... | https://www.reuters.com/article/us-china-econo... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 3 | China | 73 | CHN | Upper middle income | SUP | 3/3/20 | Financial Markets/NBFI | NBFI ... | Insurance ... | Commercial insurance companies will be support... | https://www.china-briefing.com/news/china-covi... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 4 | China | 188 | CHN | Upper middle income | CB | 3/16/20 | Liquidity/funding | Liquidity (incl FX)/ELA ... | Blank ... | Reduce the RRR rate for certain qualified bank... | NaN | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 3629 | Niger | 1334 | NER | Low income | CB | 4/3/20 | Payment systems | Easing regulatory requirements ... | Blank ... | Relaxation of requirements for opening electro... | https://www.bceao.int/fr/communique-presse/com... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3630 | Niger | 1335 | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | Reduction of 50% on ATM fees on the GIM-UEMOA ... | https://www.bceao.int/fr/communique-presse/com... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3631 | Niger | 1336 | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | Free mobile money transactions for amounts les... | https://www.bceao.int/fr/communique-presse/com... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3632 | Niger | 1337 | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | \n Reduction of 50% on fees paid by the merch... | https://www.bceao.int/fr/communique-presse/com... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3633 | Niger | 1338 | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | \n Free payment of water and electricity bill... | https://www.bceao.int/fr/communique-presse/com... | NaN | No | NaN | GDP (current US$) | NY.GDP.MKTP.CD | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
3634 rows × 20 columns
Only data relevant to analysis is kept; irrelevant columns are dropped from the merged dataset
#Defining a list with the relevant columns for analysis and cleaning
cols=['Country Name','Country ISO3','Income Level','Authority', 'Date', 'Level 1 policy measures','Level 2 policy measures', 'Level 3 policy measures', 'Details of the measure', 'Modification of Parent Measure', 'Termination Date', 'Indicator Name','2018', '2019','2020','2021']
merged_data=merged_data[cols]
merged_data
| Country Name | Country ISO3 | Income Level | Authority | Date | Level 1 policy measures | Level 2 policy measures | Level 3 policy measures | Details of the measure | Modification of Parent Measure | Termination Date | Indicator Name | 2018 | 2019 | 2020 | 2021 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | China | CHN | Upper middle income | SUP | 2/1/20 | Banking sector | Operational continuity ... | Blank ... | Require banks and insurance companies to ensur... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 1 | China | CHN | Upper middle income | CB | 2/5/20 | Banking sector | Integrity ... | Other integrity ... | The PBC has issued Notices on AML/CFT requirem... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 2 | China | CHN | Upper middle income | CB | 2/17/20 | Liquidity/funding | Policy rate ... | Blank ... | Medium-term lending facility (MLF) rate cut by... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 3 | China | CHN | Upper middle income | SUP | 3/3/20 | Financial Markets/NBFI | NBFI ... | Insurance ... | Commercial insurance companies will be support... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 4 | China | CHN | Upper middle income | CB | 3/16/20 | Liquidity/funding | Liquidity (incl FX)/ELA ... | Blank ... | Reduce the RRR rate for certain qualified bank... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 3629 | Niger | NER | Low income | CB | 4/3/20 | Payment systems | Easing regulatory requirements ... | Blank ... | Relaxation of requirements for opening electro... | No | NaN | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3630 | Niger | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | Reduction of 50% on ATM fees on the GIM-UEMOA ... | No | NaN | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3631 | Niger | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | Free mobile money transactions for amounts les... | No | NaN | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3632 | Niger | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | \n Reduction of 50% on fees paid by the merch... | No | NaN | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
| 3633 | Niger | NER | Low income | CB | 4/3/20 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | \n Free payment of water and electricity bill... | No | NaN | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 |
3634 rows × 16 columns
#renaming the columns.
merged_data.rename(columns={'Country ISO3':'Country Code','Date':'Policy Implementation Date','Details of the measure':' Policy Implementation Details','Modification of Parent Measure':'Policy Modifications','Termination Date': 'Policy Termination Date'}, inplace=True)
merged_data.head()
| Country Name | Country Code | Income Level | Authority | Policy Implementation Date | Level 1 policy measures | Level 2 policy measures | Level 3 policy measures | Policy Implementation Details | Policy Modifications | Policy Termination Date | Indicator Name | 2018 | 2019 | 2020 | 2021 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | China | CHN | Upper middle income | SUP | 2/1/20 | Banking sector | Operational continuity ... | Blank ... | Require banks and insurance companies to ensur... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 1 | China | CHN | Upper middle income | CB | 2/5/20 | Banking sector | Integrity ... | Other integrity ... | The PBC has issued Notices on AML/CFT requirem... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 2 | China | CHN | Upper middle income | CB | 2/17/20 | Liquidity/funding | Policy rate ... | Blank ... | Medium-term lending facility (MLF) rate cut by... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 3 | China | CHN | Upper middle income | SUP | 3/3/20 | Financial Markets/NBFI | NBFI ... | Insurance ... | Commercial insurance companies will be support... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
| 4 | China | CHN | Upper middle income | CB | 3/16/20 | Liquidity/funding | Liquidity (incl FX)/ELA ... | Blank ... | Reduce the RRR rate for certain qualified bank... | No | NaN | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 |
#Removing blank spaces in the country name
covid_db['Country Name']=covid_db['Country Name'].str.strip()
#remove white spaces from the column to rename
merged_data['Authority'] = merged_data['Authority'].str.strip()
#replacing blank values
merged_data['Authority'] = merged_data['Authority'].replace(r'^\s*$', np.nan, regex=True).fillna('No Information Available')
#Replacing abbreviations with full form for better understanding
merged_data['Authority'] = merged_data['Authority'].replace(['CB','GOV','MoF','RES','SUP'],['Central Bank','Goverment','Ministry Of Finance','Resolution Authority','Supervisory Agencies'])
# Converting into datetime format for consistency
merged_data['Policy Implementation Date'] = pd.to_datetime(merged_data["Policy Implementation Date"])
# Setting up a new date format ('%m-%d-%Y') for Date column
merged_data['Policy Implementation Date'] = merged_data['Policy Implementation Date'].dt.strftime('%m-%d-%Y')
# Making the date column formats consistent with eachother
merged_data['Policy Termination Date'] = pd.to_datetime(merged_data['Policy Termination Date']).dt.strftime('%m-%d-%Y')
#Convert into datetime format
merged_data['Policy Implementation Date'] = pd.to_datetime(merged_data['Policy Implementation Date'])
merged_data['Policy Termination Date'] = pd.to_datetime(merged_data['Policy Termination Date'])
#Extracting Policy implementation year and policy termination year for analysis
merged_data['Policy Implementation Year'] = merged_data['Policy Implementation Date'].dt.year.astype(int, errors='ignore')
merged_data['Policy Termination Year'] = merged_data['Policy Termination Date'].dt.year.astype(int, errors='ignore')
#convert year columns to int/string
merged_data['Policy Implementation Year'] = merged_data['Policy Implementation Year'].astype(str)
merged_data['Policy Termination Year'] = merged_data['Policy Termination Year'].astype(str)
#split on .
merged_data['Policy Implementation Year'] = merged_data['Policy Implementation Year'].str.split(pat='\.').str[0]
merged_data['Policy Termination Year'] = merged_data['Policy Termination Year'].str.split(pat='\.').str[0]
#Repositioning the implementation year and termination year
implementation_year = merged_data.pop('Policy Implementation Year')
termination_year = merged_data.pop('Policy Termination Year')
#Inserting the popped out year columns
merged_data.insert(5, 'Policy Implementation Year', implementation_year)
merged_data.insert(12, 'Policy Termination Year', termination_year)
#Creating a new column for Month from the date_time column
merged_data['Policy Termination Month & Year'] = merged_data['Policy Termination Date'].dt.strftime('%Y-%m')
#Creating a new column for Month from the date_time column
merged_data['Policy Implementation Month & Year'] = merged_data['Policy Implementation Date'].dt.strftime('%Y-%m')
#remove white spaces from the column
merged_data['Level 1 policy measures'] = merged_data['Level 1 policy measures'].str.strip()
#remove white spaces from the column
merged_data['Level 2 policy measures'] = merged_data['Level 2 policy measures'].str.strip()
# remove white spaces from the column
merged_data['Policy Modifications'].unique()
merged_data['Policy Modifications']=merged_data['Policy Modifications'].str.strip()
# remove white spaces from the column
merged_data['Policy Modifications'].unique()
merged_data['Policy Modifications']=merged_data['Policy Modifications'].replace('No','No Modifcations')
#Calculating GDP Changes across different years
def percentage_change(col1,col2):
return ((col2 - col1) / col1) * 100
#Creating a new column for each year
merged_data['2018-2019 change'] = percentage_change(merged_data['2019'],merged_data['2018'])
merged_data['2019-2020 change'] = percentage_change(merged_data['2019'],merged_data['2020'])
merged_data['2020-2021 change'] = percentage_change(merged_data['2020'],merged_data['2021'])
merged_data
| Country Name | Country Code | Income Level | Authority | Policy Implementation Date | Policy Implementation Year | Level 1 policy measures | Level 2 policy measures | Level 3 policy measures | Policy Implementation Details | ... | Indicator Name | 2018 | 2019 | 2020 | 2021 | Policy Termination Month & Year | Policy Implementation Month & Year | 2018-2019 change | 2019-2020 change | 2020-2021 change | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | China | CHN | Upper middle income | Supervisory Agencies | 2020-02-01 | 2020 | Banking sector | Operational continuity | Blank ... | Require banks and insurance companies to ensur... | ... | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 | NaN | 2020-02 | -2.696930 | 2.855309 | 20.741125 |
| 1 | China | CHN | Upper middle income | Central Bank | 2020-02-05 | 2020 | Banking sector | Integrity | Other integrity ... | The PBC has issued Notices on AML/CFT requirem... | ... | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 | NaN | 2020-02 | -2.696930 | 2.855309 | 20.741125 |
| 2 | China | CHN | Upper middle income | Central Bank | 2020-02-17 | 2020 | Liquidity/funding | Policy rate | Blank ... | Medium-term lending facility (MLF) rate cut by... | ... | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 | NaN | 2020-02 | -2.696930 | 2.855309 | 20.741125 |
| 3 | China | CHN | Upper middle income | Supervisory Agencies | 2020-03-03 | 2020 | Financial Markets/NBFI | NBFI | Insurance ... | Commercial insurance companies will be support... | ... | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 | NaN | 2020-03 | -2.696930 | 2.855309 | 20.741125 |
| 4 | China | CHN | Upper middle income | Central Bank | 2020-03-16 | 2020 | Liquidity/funding | Liquidity (incl FX)/ELA | Blank ... | Reduce the RRR rate for certain qualified bank... | ... | GDP (current US$) | 1.389482e+13 | 1.427994e+13 | 1.468767e+13 | 1.773406e+13 | NaN | 2020-03 | -2.696930 | 2.855309 | 20.741125 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 3629 | Niger | NER | Low income | Central Bank | 2020-04-03 | 2020 | Payment systems | Easing regulatory requirements | Blank ... | Relaxation of requirements for opening electro... | ... | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 | NaN | 2020-04 | -0.834553 | 6.386607 | 8.802402 |
| 3630 | Niger | NER | Low income | Central Bank | 2020-04-03 | 2020 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | Reduction of 50% on ATM fees on the GIM-UEMOA ... | ... | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 | NaN | 2020-04 | -0.834553 | 6.386607 | 8.802402 |
| 3631 | Niger | NER | Low income | Central Bank | 2020-04-03 | 2020 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | Free mobile money transactions for amounts les... | ... | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 | NaN | 2020-04 | -0.834553 | 6.386607 | 8.802402 |
| 3632 | Niger | NER | Low income | Central Bank | 2020-04-03 | 2020 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | \n Reduction of 50% on fees paid by the merch... | ... | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 | NaN | 2020-04 | -0.834553 | 6.386607 | 8.802402 |
| 3633 | Niger | NER | Low income | Central Bank | 2020-04-03 | 2020 | Payment systems | Promoting and ensuring availability of digital... | Blank ... | \n Free payment of water and electricity bill... | ... | GDP (current US$) | 1.280866e+10 | 1.291646e+10 | 1.374138e+10 | 1.495095e+10 | NaN | 2020-04 | -0.834553 | 6.386607 | 8.802402 |
3634 rows × 23 columns
# Determing the countries with best and worst GDP changes from 2020 through 2021
best_gdp_2020_2021=merged_data.sort_values(by='2020-2021 change',ascending=False)
worst_gdp_2020_2021=merged_data.sort_values(by='2020-2021 change',ascending=True)
# Creating a dataframe for the top ten countries with best gdp changes for the year 2020-2021
best_gdp_2020_2021=best_gdp_2020_2021[['Country Name','2020-2021 change']]
best_gdp_2020_2021=best_gdp_2020_2021.drop_duplicates(ignore_index=True).head(10)
best_gdp_2020_2021.reset_index(drop=True,inplace=True)
best_gdp_2020_2021
| Country Name | 2020-2021 change | |
|---|---|---|
| 0 | Zimbabwe | 45.241143 |
| 1 | Haiti | 44.362268 |
| 2 | Guyana | 35.420078 |
| 3 | Angola | 35.300713 |
| 4 | Maldives | 30.642999 |
| 5 | Azerbaijan | 27.941762 |
| 6 | Ukraine | 27.753971 |
| 7 | Sudan | 27.192137 |
| 8 | Argentina | 26.156060 |
| 9 | Chile | 25.454845 |
# Creating a dataframe for the top ten countries with worst gdp changes for the year 2020-2021
worst_gdp_2020_2021=worst_gdp_2020_2021[['Country Name','2020-2021 change']]
worst_gdp_2020_2021=worst_gdp_2020_2021.drop_duplicates(ignore_index=True).head(10)
worst_gdp_2020_2021.reset_index(drop=True,inplace=True)
worst_gdp_2020_2021
| Country Name | 2020-2021 change | |
|---|---|---|
| 0 | Lebanon | -30.337649 |
| 1 | Libya | -19.955261 |
| 2 | Myanmar | -17.562908 |
| 3 | Samoa | -2.323932 |
| 4 | Japan | -2.037375 |
| 5 | Jamaica | -1.261140 |
| 6 | Micronesia, Fed. Sts. | -0.819079 |
| 7 | Lao PDR | -0.814739 |
| 8 | Suriname | -0.766788 |
| 9 | St. Kitts and Nevis | -0.484779 |
Lebanon is the worst-performing country with a drop of 30% from 2020 GDP to 2021 GDP. It is followed by Libya at a 20% drop, closely followed by Myanmar at a 17.5% decrease. (From subset worst_gdp_2020_2021)
COVID-19 contributed heavily to these losses, but it was not only poorly planned COVID-19 fiscal policies that lead to this drop. The external factors leading to this are:
Lebanon took a big hit on its economy with the Beirut port blast in 2020. This immediately led to a weakening local currency and losses in human life, food resources and trade. Source: Schlein, L. (2021) Economic fallout of Beirut Blast plunges millions into poverty, VOA. Voice of America (VOA News). Available at: https://www.voanews.com/a/middle-east_economic-fallout-beirut-blast-plunges-millions-poverty/6209118.html (Accessed: December 5, 2022).
Libya has been facing instability since the death of its former leader Muammar al-Qaddafi in October 2011. They faced deteriorating security issues with a large-displaced population. With the ongoing conflict severely impacting the country's medical system, they faced severe issues tackling COVID-19. Source: United Nations High Commissioner for Refugees. Libya: Humanitarian crisis worsening amid deepening conflict and covid-19 threat. UNHCR. https://www.unhcr.org/news/briefing/2020/4/5e86f2cc4/libya-humanitarian-crisis-worsening-amid-deepening-conflict-covid-19-threat.html. Accessed December 5, 2022.
Myanmar implemented COVID-19 restrictions early but internal unrest, inadequate testing capacity and an unprepared health system led to the worsening of its economy until it finally collapsed in 2022. Source: Welle (www.dw.com) D. Myanmar on brink of economic collapse one year after military coup | DW | 01.02.2022. DW.COM. https://www.dw.com/en/myanmar-on-brink-of-economic-collapse-one-year-after-military-coup/a-60621514 Traill AD Khaing Thandar Hnin, and Tom. Myanmar’s response to the COVID-19 pandemic. Brookings. Published December 1, 2020. https://www.brookings.edu/blog/future-development/2020/12/01/myanmars-response-to-the-covid-19-pandemic/
#Percent of GDP change for all countries from 2018 - 2021
gdp_change_percent = merged_data.melt(id_vars=['Country Name','Country Code'],
value_vars=['2018-2019 change','2019-2020 change','2020-2021 change'],
var_name='Year', value_name='GDP Change Percentage')
#Convert it into the appropriate datatype
gdp_change_percent['GDP Change Percentage'] = gdp_change_percent["GDP Change Percentage"].astype(float)
# Defining the mapbox plot
fig_map = px.choropleth(gdp_change_percent, locations='Country Code', hover_name="Country Name",
color='GDP Change Percentage',
scope='world',
animation_frame ='Year',
range_color=(-50,50),
#color_continuous_scale=px.colors.sequential.Viridis,
color_continuous_scale='Hot',
#color_continuous_scale=[(0, "red"), (1, "green")],
projection="natural earth"
)
# Adding Buttons
fig_map.layout.updatemenus[0].buttons[0].args[1]["frame"]["duration"] = 1000
fig_map.update_geos(visible=False, resolution=50, scope="world",
showcountries=True, countrycolor="Black")
# Defining an appropriate margin
fig_map.update_layout(margin={"r":0,"t":25,"l":0,"b":0},
title="GDP % change from 2018 - 2021",
mapbox_style='open-street-map')
fig_map.show()
# Creating a dataframe to analyse the policy termination date and the Number of Policies
month_year_termination_data=merged_data[['Country Name','Policy Termination Month & Year']]
month_year_termination_data = month_year_termination_data.groupby('Policy Termination Month & Year').count()
month_year_termination_data.rename(columns={'Country Name':'Number of Policies'},inplace=True)
month_year_termination_data.reset_index(inplace=True)
# Creating a dataframe to analyse the policy Implementation date and the Number of Policies
month_year_implementation_data=merged_data[['Country Name','Policy Implementation Month & Year']]
# Using groupby() and count()
month_year_implementation_data = month_year_implementation_data.groupby('Policy Implementation Month & Year').count()
month_year_implementation_data.rename(columns={'Country Name':'Number of Policies'},inplace=True)
month_year_implementation_data.reset_index(inplace=True)
month_year_implementation_data
| Policy Implementation Month & Year | Number of Policies | |
|---|---|---|
| 0 | 2020-02 | 31 |
| 1 | 2020-03 | 1208 |
| 2 | 2020-04 | 977 |
| 3 | 2020-05 | 404 |
| 4 | 2020-06 | 364 |
| 5 | 2020-07 | 175 |
| 6 | 2020-08 | 109 |
| 7 | 2020-09 | 128 |
| 8 | 2020-10 | 32 |
| 9 | 2020-11 | 25 |
| 10 | 2020-12 | 159 |
| 11 | 2021-01 | 11 |
| 12 | 2021-02 | 9 |
| 13 | 2021-03 | 1 |
# Create a line chart to display the Policy termination and implementation data
import plotly.graph_objects as go
termination_implementation = go.Figure()
termination_implementation.add_trace(go.Scatter(x=month_year_termination_data['Policy Termination Month & Year'], y=month_year_termination_data['Number of Policies'], name="Terminated Policies", mode='lines+markers'))
termination_implementation.add_trace(go.Scatter(x=month_year_implementation_data['Policy Implementation Month & Year'], y=month_year_implementation_data['Number of Policies'], name="Implemented Policies", mode="lines+markers"))
termination_implementation.update_layout(
title="Number of Policies Implemented and Terminated all around the globe by month and year ", xaxis_title="Month Year", yaxis_title="Number of Policies"
)
termination_implementation.show()
# Creating a new dataframe to analyse income level data of best performing countries
income_best=merged_data[['Country Name','Income Level','2020','2021','2020-2021 change']]
income_best=income_best[income_best['Country Name'].isin(best_gdp_2020_2021['Country Name'])]
income_best=income_best.sort_values(by='2020-2021 change',ascending=False).drop_duplicates(ignore_index=True)
income_best
| Country Name | Income Level | 2020 | 2021 | 2020-2021 change | |
|---|---|---|---|---|---|
| 0 | Zimbabwe | Lower middle income | 1.805117e+10 | 2.621773e+10 | 45.241143 |
| 1 | Haiti | Low income | 1.450822e+10 | 2.094439e+10 | 44.362268 |
| 2 | Guyana | Upper middle income | 5.471257e+09 | 7.409180e+09 | 35.420078 |
| 3 | Angola | Lower middle income | 5.361907e+10 | 7.254699e+10 | 35.300713 |
| 4 | Maldives | Upper middle income | 3.742770e+09 | 4.889667e+09 | 30.642999 |
| 5 | Azerbaijan | Upper middle income | 4.269300e+10 | 5.462218e+10 | 27.941762 |
| 6 | Ukraine | Lower middle income | 1.566179e+11 | 2.000855e+11 | 27.753971 |
| 7 | Sudan | Lower middle income | 2.698756e+10 | 3.432606e+10 | 27.192137 |
| 8 | Argentina | Upper middle income | 3.895910e+11 | 4.914927e+11 | 26.156060 |
| 9 | Chile | High income | 2.527272e+11 | 3.170585e+11 | 25.454845 |
# Grouping by Income Level to calculate the frequency of income levels
income_best=income_best[['Country Name','Income Level']]
best_income_level = income_best.groupby('Income Level').count()
best_income_level.rename(columns={'Country Name':'Frequency of Income Levels'},inplace=True)
# Creating a new dataframe to analyse income level data of worst performing countries
income_worst=merged_data[['Country Name','Income Level','2020','2021','2020-2021 change']]
income_worst=income_worst[income_worst['Country Name'].isin(worst_gdp_2020_2021['Country Name'])]
income_worst=income_worst.sort_values(by='2020-2021 change',ascending=True).drop_duplicates(ignore_index=True)
income_worst
| Country Name | Income Level | 2020 | 2021 | 2020-2021 change | |
|---|---|---|---|---|---|
| 0 | Lebanon | Upper middle income | 2.594892e+10 | 1.807662e+10 | -30.337649 |
| 1 | Libya | Upper middle income | 5.232022e+10 | 4.187958e+10 | -19.955261 |
| 2 | Myanmar | Lower middle income | 7.893026e+10 | 6.506781e+10 | -17.562908 |
| 3 | Samoa | Upper middle income | 8.071475e+08 | 7.883900e+08 | -2.323932 |
| 4 | Japan | High income | 5.040108e+12 | 4.937422e+12 | -2.037375 |
| 5 | Jamaica | Upper middle income | 1.381243e+10 | 1.363823e+10 | -1.261140 |
| 6 | Micronesia, Fed. Sts. | Lower middle income | 4.075159e+08 | 4.041780e+08 | -0.819079 |
| 7 | Lao PDR | Lower middle income | 1.898180e+10 | 1.882715e+10 | -0.814739 |
| 8 | Suriname | Upper middle income | 2.884248e+09 | 2.862132e+09 | -0.766788 |
| 9 | St. Kitts and Nevis | High income | 9.809059e+08 | 9.761507e+08 | -0.484779 |
# Grouping by Income Level to calculate the frequency of income levels
income_worst=income_worst[['Country Name','Income Level']]
income_level_worst = income_worst.groupby('Income Level').count()
income_level_worst.rename(columns={'Country Name':'Frequency of Income Levels'},inplace=True)
# Create a plot to display the income levels of the best and worst performing countries
from plotly.subplots import make_subplots
import plotly.graph_objects as go
sub = make_subplots(rows=1, cols=2)
sub.add_trace(go.Bar(x=best_income_level.index, y=best_income_level['Frequency of Income Levels'],name="Frequency of Income Level types of Best performing countries"),
row=1, col=1
)
sub.add_trace(
go.Bar(x=income_level_worst.index, y=income_level_worst['Frequency of Income Levels'],name="Frequency of Income Level types of Worst performing countries"),
row=1, col=2
)
sub.update_layout(height=500, width=1400, title_text="Frequency of Income Level in Best and Worst performing countries in 2020-2021")
sub.show()
# Creating a new dataframe to analyse authority data of best performing countries
authority_best=merged_data[['Country Name','Authority','2020','2021','2020-2021 change']]
authority_best=authority_best[authority_best['Country Name'].isin(best_gdp_2020_2021['Country Name'])]
authority_best.drop_duplicates(inplace=True)
authority_best.sort_values(by='2020-2021 change',ascending=False,inplace=True)
authority_best
| Country Name | Authority | 2020 | 2021 | 2020-2021 change | |
|---|---|---|---|---|---|
| 3126 | Zimbabwe | Supervisory Agencies | 1.805117e+10 | 2.621773e+10 | 45.241143 |
| 3125 | Zimbabwe | Ministry Of Finance | 1.805117e+10 | 2.621773e+10 | 45.241143 |
| 3113 | Zimbabwe | Goverment | 1.805117e+10 | 2.621773e+10 | 45.241143 |
| 3111 | Zimbabwe | Central Bank | 1.805117e+10 | 2.621773e+10 | 45.241143 |
| 2403 | Haiti | Central Bank | 1.450822e+10 | 2.094439e+10 | 44.362268 |
| 459 | Guyana | Central Bank | 5.471257e+09 | 7.409180e+09 | 35.420078 |
| 469 | Guyana | Goverment | 5.471257e+09 | 7.409180e+09 | 35.420078 |
| 3152 | Angola | Goverment | 5.361907e+10 | 7.254699e+10 | 35.300713 |
| 3151 | Angola | Ministry Of Finance | 5.361907e+10 | 7.254699e+10 | 35.300713 |
| 3148 | Angola | Central Bank | 5.361907e+10 | 7.254699e+10 | 35.300713 |
| 2415 | Maldives | Ministry Of Finance | 3.742770e+09 | 4.889667e+09 | 30.642999 |
| 2411 | Maldives | Central Bank | 3.742770e+09 | 4.889667e+09 | 30.642999 |
| 2414 | Maldives | Other | 3.742770e+09 | 4.889667e+09 | 30.642999 |
| 893 | Azerbaijan | No Information Available | 4.269300e+10 | 5.462218e+10 | 27.941762 |
| 869 | Azerbaijan | Other | 4.269300e+10 | 5.462218e+10 | 27.941762 |
| 841 | Azerbaijan | Central Bank | 4.269300e+10 | 5.462218e+10 | 27.941762 |
| 840 | Azerbaijan | Goverment | 4.269300e+10 | 5.462218e+10 | 27.941762 |
| 2173 | Ukraine | Ministry Of Finance | 1.566179e+11 | 2.000855e+11 | 27.753971 |
| 2163 | Ukraine | Central Bank | 1.566179e+11 | 2.000855e+11 | 27.753971 |
| 3509 | Sudan | Central Bank | 2.698756e+10 | 3.432606e+10 | 27.192137 |
| 778 | Argentina | Supervisory Agencies | 3.895910e+11 | 4.914927e+11 | 26.156060 |
| 775 | Argentina | Goverment | 3.895910e+11 | 4.914927e+11 | 26.156060 |
| 771 | Argentina | Other | 3.895910e+11 | 4.914927e+11 | 26.156060 |
| 764 | Argentina | Central Bank | 3.895910e+11 | 4.914927e+11 | 26.156060 |
| 2585 | Chile | Central Bank | 2.527272e+11 | 3.170585e+11 | 25.454845 |
| 2591 | Chile | Other | 2.527272e+11 | 3.170585e+11 | 25.454845 |
| 2595 | Chile | Goverment | 2.527272e+11 | 3.170585e+11 | 25.454845 |
| 2596 | Chile | Supervisory Agencies | 2.527272e+11 | 3.170585e+11 | 25.454845 |
| 2601 | Chile | Ministry Of Finance | 2.527272e+11 | 3.170585e+11 | 25.454845 |
# Grouping by authority Level to calculate the frequency of authority levels
authority_best=authority_best[['Country Name','Authority']]
authority_best = authority_best.groupby('Authority').count()
authority_best.rename(columns={'Country Name':'Frequency of Authorities'},inplace=True)
authority_best.reset_index(inplace=True)
authority_best
| Authority | Frequency of Authorities | |
|---|---|---|
| 0 | Central Bank | 10 |
| 1 | Goverment | 6 |
| 2 | Ministry Of Finance | 5 |
| 3 | No Information Available | 1 |
| 4 | Other | 4 |
| 5 | Supervisory Agencies | 3 |
# Creating a new dataframe to analyse authority data of worst performing countries
authority_worst=merged_data[['Country Name','Authority','2020','2021','2020-2021 change']]
authority_worst=authority_worst[authority_worst['Country Name'].isin(worst_gdp_2020_2021['Country Name'])]
authority_worst.drop_duplicates(inplace=True)
authority_worst.sort_values(by='2020-2021 change',ascending=True,inplace=True)
authority_worst
| Country Name | Authority | 2020 | 2021 | 2020-2021 change | |
|---|---|---|---|---|---|
| 3064 | Lebanon | Goverment | 2.594892e+10 | 1.807662e+10 | -30.337649 |
| 3062 | Lebanon | Central Bank | 2.594892e+10 | 1.807662e+10 | -30.337649 |
| 3137 | Libya | Central Bank | 5.232022e+10 | 4.187958e+10 | -19.955261 |
| 1628 | Myanmar | Central Bank | 7.893026e+10 | 6.506781e+10 | -17.562908 |
| 1629 | Myanmar | Goverment | 7.893026e+10 | 6.506781e+10 | -17.562908 |
| 3139 | Samoa | Goverment | 8.071475e+08 | 7.883900e+08 | -2.323932 |
| 3138 | Samoa | Central Bank | 8.071475e+08 | 7.883900e+08 | -2.323932 |
| 252 | Japan | Ministry Of Finance | 5.040108e+12 | 4.937422e+12 | -2.037375 |
| 274 | Japan | Goverment | 5.040108e+12 | 4.937422e+12 | -2.037375 |
| 255 | Japan | Central Bank | 5.040108e+12 | 4.937422e+12 | -2.037375 |
| 253 | Japan | Supervisory Agencies | 5.040108e+12 | 4.937422e+12 | -2.037375 |
| 3100 | Jamaica | Central Bank | 1.381243e+10 | 1.363823e+10 | -1.261140 |
| 3103 | Jamaica | Other | 1.381243e+10 | 1.363823e+10 | -1.261140 |
| 3472 | Micronesia, Fed. Sts. | Goverment | 4.075159e+08 | 4.041780e+08 | -0.819079 |
| 2769 | Lao PDR | Central Bank | 1.898180e+10 | 1.882715e+10 | -0.814739 |
| 3498 | Suriname | Central Bank | 2.884248e+09 | 2.862132e+09 | -0.766788 |
| 3497 | Suriname | Goverment | 2.884248e+09 | 2.862132e+09 | -0.766788 |
| 3550 | St. Kitts and Nevis | Central Bank | 9.809059e+08 | 9.761507e+08 | -0.484779 |
# Grouping by authority Level to calculate the frequency of authority levels
authority_worst=authority_worst[['Country Name','Authority']]
authority_worst = authority_worst.groupby('Authority').count()
authority_worst.rename(columns={'Country Name':'Frequency of Authorities'},inplace=True)
authority_worst.reset_index(inplace=True)
authority_worst
| Authority | Frequency of Authorities | |
|---|---|---|
| 0 | Central Bank | 9 |
| 1 | Goverment | 6 |
| 2 | Ministry Of Finance | 1 |
| 3 | Other | 1 |
| 4 | Supervisory Agencies | 1 |
# Merging both the dataframes to create a single one for analysis
authority=pd.merge(authority_best,authority_worst,on='Authority')
authority.rename(columns={'Frequency of Authorities_x':'Best Performing Countries','Frequency of Authorities_y':'Worst Performing Countries'},inplace=True)
authority
| Authority | Best Performing Countries | Worst Performing Countries | |
|---|---|---|---|
| 0 | Central Bank | 10 | 9 |
| 1 | Goverment | 6 | 6 |
| 2 | Ministry Of Finance | 5 | 1 |
| 3 | Other | 4 | 1 |
| 4 | Supervisory Agencies | 3 | 1 |
# Creating a bar plot to display the different authority levels of both the Best and Worst Performing Countries
import plotly.express as px
# df = px.data.iris()
fig000 = px.bar(authority, x="Authority", y=["Best Performing Countries","Worst Performing Countries"],barmode='group',text_auto=True,
labels={
"value": "Frequency of Authorities",
"variable":"Countries"
},
color_discrete_sequence=["red", "blue"],
)
fig000.update_xaxes(showgrid=False)
fig000.update_yaxes(showgrid=False)
fig000.update_layout(height=500, width=1400, title_text="Frequency of Authorities in Best and Worst performing countries in 2020-2021")
fig000.show()
# Creating a dataframe to analyze the level 1 policies of the best performing countries
level1_best=merged_data[['Country Name','Level 1 policy measures','2020','2021','2020-2021 change']]
level1_best=level1_best[level1_best['Country Name'].isin(best_gdp_2020_2021['Country Name'])]
level1_best.drop_duplicates(inplace=True)
level1_best.sort_values(by='2020-2021 change',ascending=False,inplace=True)
level1_best.sort_values(by='Level 1 policy measures',inplace=True)
print("Frequency of Level 1 Policy Measures in top 10 countries having best gdp change:")
level1_best_counts=level1_best['Level 1 policy measures'].value_counts()
level1_best_counts
Frequency of Level 1 Policy Measures in top 10 countries having best gdp change:
Banking sector 10 Liquidity/funding 8 Payment systems 7 Financial Markets/NBFI 6 Insolvency 1 Name: Level 1 policy measures, dtype: int64
# Creating a dataframe to analyze the level 1 policies of the worst performing countries
level1_worst=merged_data[['Country Name','Level 1 policy measures','2020','2021','2020-2021 change']]
level1_worst=level1_worst[level1_worst['Country Name'].isin(worst_gdp_2020_2021['Country Name'])]
level1_worst.drop_duplicates(inplace=True)
level1_worst.sort_values(by='2020-2021 change',ascending=False,inplace=True)
level1_worst.sort_values(by='Level 1 policy measures',inplace=True)
print("Frequency of Level 1 Policy Measures in bottom 10 countries having worst gdp change:")
level1_worst_counts=level1_worst['Level 1 policy measures'].value_counts()
level1_worst_counts
Frequency of Level 1 Policy Measures in bottom 10 countries having worst gdp change:
Banking sector 10 Liquidity/funding 6 Payment systems 3 Financial Markets/NBFI 2 Insolvency 1 Name: Level 1 policy measures, dtype: int64
# Create a scatter plot for analysing the Level 1 policy measures
import plotly.express as px
level1_plot_best = px.scatter(level1_best, x='Country Name', y='Level 1 policy measures',
color='Level 1 policy measures',symbol='Level 1 policy measures')
level1_plot_best.update_traces(marker_size=10)
level1_plot_best.update_xaxes(showgrid=True)
level1_plot_best.update_yaxes(showgrid=True)
level1_plot_best.update_layout(height=500, width=1400, title_text="Level 1 Policy Measures Implemented by Best Performing Countries")
level1_plot_best.show()
level1_plot_worst = px.scatter(level1_worst, x='Country Name', y='Level 1 policy measures',
color='Level 1 policy measures',symbol='Level 1 policy measures')
level1_plot_worst.update_traces(marker_size=10)
level1_plot_worst.update_xaxes(showgrid=True)
level1_plot_worst.update_yaxes(showgrid=True)
level1_plot_worst.update_layout(height=500, width=1400, title_text="Level 1 Policy Measures Implemented by Worst Performing Countries")
level1_plot_worst.show()
7 of the 10 best-performing countries aggressively promoted investments while all of the best-performing countries took measures to protect their banks and other financial institutions. Only 2 of the 10 worst-performing countries took measures to promote investments and 8 of the 10 countries did not take any measures to protect their banks and other financial institutions.¶8 of the 10 best-performing countries took measures to increase liquidity in their markets. High liquidity helps countries and their people meet their short-term debts. Only 5 of the 10 worst-performing countries took measures to increase liquidity in the market.¶#list to recategorize data
support_borrowers = ['Other Payments','Support borrowers','Public debt management','Amending bankruptcy filing obligations','Policy rate']
market_movement = ['Operational continuity','Market functioning']
increasing_liquidity = ['Other liquidity','Consumer protection measures and ensuring availability and acceptance of cash','Easing regulatory requirements','Liquidity (incl FX)/ELA']
banking_protection = ['Crisis management','Prudential','NBFI']
digital_payments = ['Promoting and ensuring availability of digital payment mechanisms']
promoting_investments = ['Asset purchases','Integrity']
#add a new column
merged_data["Level 2 Recategorized policy measures"] = ''
#create a new column with recategorized data of Level 2 measures
merged_data["Level 2 Recategorized policy measures"] = np.where(merged_data["Level 2 policy measures"].isin(support_borrowers), "Support Borrowers", merged_data["Level 2 Recategorized policy measures"])
merged_data["Level 2 Recategorized policy measures"] = np.where(merged_data["Level 2 policy measures"].isin(market_movement), "Market Movement Measures", merged_data["Level 2 Recategorized policy measures"])
merged_data["Level 2 Recategorized policy measures"] = np.where(merged_data["Level 2 policy measures"].isin(increasing_liquidity), "Increasing Liquidity", merged_data["Level 2 Recategorized policy measures"])
merged_data["Level 2 Recategorized policy measures"] = np.where(merged_data["Level 2 policy measures"].isin(banking_protection), "Banking Protection", merged_data["Level 2 Recategorized policy measures"])
merged_data["Level 2 Recategorized policy measures"] = np.where(merged_data["Level 2 policy measures"].isin(promoting_investments), 'Promoting Investments', merged_data["Level 2 Recategorized policy measures"])
merged_data["Level 2 Recategorized policy measures"] = np.where(merged_data["Level 2 policy measures"].isin(digital_payments), 'Promoted Digital Payments', merged_data["Level 2 Recategorized policy measures"])
# Creating a dataframe to analyze the level 2 policies of the best performing countries
level2_best=merged_data[['Country Name','Level 2 Recategorized policy measures','2020','2021','2020-2021 change']]
level2_best=level2_best[level2_best['Country Name'].isin(best_gdp_2020_2021['Country Name'])]
level2_best.drop_duplicates(inplace=True)
level2_best.sort_values(by='2020-2021 change',ascending=False,inplace=True)
level2_best=level2_best[['Country Name','Level 2 Recategorized policy measures']]
level2_best.drop_duplicates(inplace=True)
level2_best.sort_values(by='Level 2 Recategorized policy measures',ascending=False,inplace=True)
print("Frequency of Level 2 Policy Measures in top 10 countries having best gdp change:")
level2_best_counts=level2_best['Level 2 Recategorized policy measures'].value_counts()
level2_best_counts
Frequency of Level 2 Policy Measures in top 10 countries having best gdp change:
Support Borrowers 10 Banking Protection 8 Promoting Investments 7 Increasing Liquidity 7 Promoted Digital Payments 6 Market Movement Measures 6 Name: Level 2 Recategorized policy measures, dtype: int64
# Creating a dataframe to analyze the level 2 policies of the worst performing countries
level2_worst=merged_data[['Country Name','Level 2 Recategorized policy measures','2020','2021','2020-2021 change']]
level2_worst=level2_worst[level2_worst['Country Name'].isin(worst_gdp_2020_2021['Country Name'])]
level2_worst.drop_duplicates(inplace=True)
level2_worst.sort_values(by='2020-2021 change',ascending=False,inplace=True)
level2_worst=level2_worst[['Country Name','Level 2 Recategorized policy measures']]
level2_worst.drop_duplicates(inplace=True)
level2_worst.sort_values(by='Level 2 Recategorized policy measures',ascending=False,inplace=True)
print("Frequency of Level 2 Policy Measures in bottom 10 countries having worst gdp change:")
level2_worst_counts=level2_worst['Level 2 Recategorized policy measures'].value_counts()
level2_worst_counts
Frequency of Level 2 Policy Measures in bottom 10 countries having worst gdp change:
Support Borrowers 10 Banking Protection 6 Increasing Liquidity 5 Market Movement Measures 3 Promoting Investments 2 Promoted Digital Payments 2 Name: Level 2 Recategorized policy measures, dtype: int64
# Create a bar plot for analysing the level 2 policy measures
import plotly.express as px
level2_plot_best = px.bar(level2_best, x='Country Name', y='Level 2 Recategorized policy measures',
color='Level 2 Recategorized policy measures')
level2_plot_best.update_layout(yaxis_title=None,height=500, width=1400, title_text="Level 2 Policy Measures Implemented by Best Performing Countries",yaxis_visible=False, yaxis_showticklabels=False)
# level2_plot
level2_plot_worst = px.bar(level2_worst, x='Country Name', y='Level 2 Recategorized policy measures',
color='Level 2 Recategorized policy measures')
level2_plot_worst.update_layout(yaxis_title=None,height=500, width=1400, title_text="Level 2 Policy Measures Implemented by Worst Performing Countries",yaxis_visible=False, yaxis_showticklabels=False)
# level2_plot
level2_plot_best.show()
level2_plot_worst.show()
7 of the 10 best-performing countries actively promoted digital payments to prevent the spread of infection. 7 of the 10 worst-performing countries did not take measures to promote digital payments.¶6 of the 10 best-performing countries took aggressive market movement measures to control the prices of goods in the short term (as seen from policy termination dates). Only 3 of the 10 worst-performing countries took market movement measures.¶Government and financial institutions implementing temporary policy measures to support borrowers are necessary for most major economies to support the weakest segment of their population and ease inflation pressures. Every country primarily took measures to support borrowers and reduce debt across the nation. Even though supporting borrowers had good social benefits, it causes a decrease in value of currency due to increase in supply of money without any corresponding increase in goods and services available for purchase. Hence, it should be ensured that these measures are temporary to curb further inflation.
Only 2 of the 10 worst-performing countries took measures to promote investments and 8 of the 10 countries did not take any measures to protect their banks and other financial institutions. Maintaining the stability of the country's financial institutions significantly improves confidence in the economic situation of a country. Financial sectors control a country's stability, so protecting these institutions should be a priority to improve a country’s economy.
It is likely that the COVID-19 crisis is accelerating the shift towards digitalization. With 60% of best performing countries actively promoting digital payment mechanisms, it is speculated that the shift towards digitalization is accelerated because of this crisis. Countries that want to perform better on a longer run should start investing more in their digital economy. If they don't start soon, it could lead to further aggravation in net wage and unemployment of their people.